/*
 * @Author: HeAo
 * @Date: 2022-09-14 11:10:36
 * @LastEditTime: 2022-09-14 14:03:43
 * @LastEditors: HeAo
 * @Description: 
 * @FilePath: \第二阶段\ES6\day02\6-拓展运算符.js
 * 别乱动！
 */
let arr = [1, 2, 3, 4]
// 用于左侧时：聚合   用右侧时：展开
let [...a] = arr
console.log(a); //[ 1, 2, 3, 4 ]

let obj = {
  name: 'zhangsan',
  age: 12
}
let obj1 = {
  gender: 'male'
}

let temp = {
  ...obj,
  ...obj1
}
temp.width = '100px'
console.log(temp); //{ name: 'zhangsan', age: 12, gender: 'male', width: '100px' }